package com.zklh.leetcode.top100.problem148;

import com.zklh.leetcode.tree.model.ListNode;

/**
 * 排序链表， 给你链表的头结点 head ，请将其按 升序 排列并返回 排序后的链
 */
public class Solution148 {
    public ListNode sortList(ListNode head) {
        if (head == null) {
            return head;
        }
        ListNode last = head;
        ListNode point = head.next;
        ListNode temp = null;
        while (point != null) {
            if (point.val < last.val) {
                temp = head;
                while (temp != last) {
                    if (temp.val < point.val) {
                        temp = temp.next;
                    } else {

                    }
                }

            }
        }

        return null;
    }


    public static void main(String[] args) {
        Solution148 solution = new Solution148();
        ListNode head = new ListNode(4);
        head.next = new ListNode(2);
        head.next.next = new ListNode(1);
        head.next.next.next = new ListNode(1);
        solution.sortList(head);
    }
}
